package com.xxxx.server.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xxxx.server.mapper.InucleicMapper;
import com.xxxx.server.pojo.Inucleic;
import com.xxxx.server.pojo.RespPageBean;
import com.xxxx.server.pojo.Snucleic;
import com.xxxx.server.mapper.SnucleicMapper;
import com.xxxx.server.service.ISnucleicService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 学生核酸登记登记表 服务实现类
 * </p>
 *
 * @author zhoubin
 * @since 2022-06-04
 */
@Service
public class SnucleicServiceImpl extends ServiceImpl<SnucleicMapper, Snucleic> implements ISnucleicService {

    @Autowired
    private SnucleicMapper snucleicMapper;

    @Override
    public RespPageBean getSnucleicByPage(Integer currentPage, Integer size, Snucleic snucleic, String[] beginDateScope, int type, String collegeName, int collegeid,int classid,String classname) {
        //开启分页
        Page<Snucleic> page = new Page<>(currentPage,size);
        IPage<Snucleic> snucleicByPage = snucleicMapper.getSnucleicByPage(page, snucleic, beginDateScope,type,collegeName,collegeid,classid,classname);
        RespPageBean respPageBean = new RespPageBean(snucleicByPage.getTotal(), snucleicByPage.getRecords());
        return respPageBean;
    }

    @Override
    public List<Snucleic> getSnucleicSeachList(Snucleic snucleic, String[] beginDateScope, int type, String collegename, int collegeid,int classid,String classname) {
        return snucleicMapper.getSnucleicSeachList(snucleic, beginDateScope,type,collegename,collegeid,classid,classname);
    }

}
